﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:MissedMemo.MeatAndCheeseDisc.OrderEntry" >
    

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="resColorScheme.xaml" />
    </ResourceDictionary.MergedDictionaries>
    
    
    <local:ElapsedTimeToColorConverter x:Key="ElapsedTimeToColorConverter"
                                       ColorError="{StaticResource brushTimerError}"
                                       ColorWarning="{StaticResource brushTimerWarning}"
                                       ColorDefault="{StaticResource brushOrderBorder}" />
    
    <local:OrderStateToColorConverter x:Key="OrderStateToColorConverter"
                                      ColorScheduled="{StaticResource brushScheduled}"
                                      ColorReady="{StaticResource brushReady}"
                                      ColorCompleted="{StaticResource brushCompleted}"
                                      ColorDefault="{StaticResource brushOrder}"/>
    
    <local:ElapsedTimeToThicknessConverter x:Key="ElapsedTimeToThicknessConverter" DefaultThickness="2" ErrorThickness="4" />
    
    <local:OrderStateToOpacityConverter x:Key="OrderStateToOpacityConverter" />


    <Style x:Key="OrderListItemStyleBase" TargetType="Border" >
        <Setter Property="Height" Value="36" />
        <Setter Property="Padding" Value="3" />
        <Setter Property="CornerRadius" Value="5" />
        <Setter Property="TextBlock.Foreground" Value="{StaticResource brushOrderText}" />
        <Setter Property="TextBlock.TextAlignment" Value="Center" />
    </Style>
    
    
    <Style x:Key="OrderListItemStyle" TargetType="Border" BasedOn="{StaticResource OrderListItemStyleBase}" >
        <Setter Property="Background" Value="{Binding ProcessingState,
            Converter={StaticResource OrderStateToColorConverter}}" />
        <Setter Property="BorderBrush" Value="{Binding Timer.ElapsedTime,
            Converter={StaticResource ElapsedTimeToColorConverter}}" />
        <Setter Property="BorderThickness" Value="{Binding Timer.ElapsedTime,
            Converter={StaticResource ElapsedTimeToThicknessConverter}}" />
        <Setter Property="Opacity" Value="{Binding ProcessingState,
            Converter={StaticResource OrderStateToOpacityConverter}}" />
    </Style>
    
    
    <Style x:Key="OrderHighlightStyle" TargetType="Border" >
        <Setter Property="Opacity" Value="0" />
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1" >
                    <GradientStop Color="#11FFFFFF" Offset="0"/>
                    <GradientStop Color="#33FFFFFF" Offset=".25"/>
                    <GradientStop Color="#33FFFFFF" Offset=".75"/>
                    <GradientStop Color="#11FFFFFF" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
    </Style>
    
    
    <Style x:Key="AddOrderButtonStyle" TargetType="Border" BasedOn="{StaticResource OrderListItemStyleBase}" >
        <Setter Property="Background" Value="{StaticResource brushAddOrderButton}" />
        <Setter Property="BorderBrush" Value="{StaticResource brushOrderBorder}" />
        <Setter Property="BorderThickness" Value="2" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True" >
                <Setter Property="Background" Value="{StaticResource brushAddOrderButtonHighlight}" />
            </Trigger>
        </Style.Triggers>
    </Style>
    

</ResourceDictionary>